<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>{$system.web_name}</title>
	<meta name="keywords" content="">
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
	<link rel="stylesheet" href="/home/css/base.css">
	<link rel="stylesheet" type="text/css" href="/home/css/swiper.min.css"/>
	<link rel="stylesheet" href="/home/css/dian.css">
	<script src="/home/js/jquery.min.js"></script>
	<script src="/home/js/swiper.min.js"></script>
</head>
<body>
	<div class="dian-content o_hidden">
		<div class="dc-top o_hidden">
			<img src="/home/img/l_03.png" alt="" class="dc-img">
			<img src="/home/img/a_06.png" alt="" class="dc-img1">
		</div>
		<div class="ac-bottom o_hidden">
			<div class="ac-list o_hidden">
				<span class="ac-pt">{$sname}</span><span class="ac-pt">批次：{if condition="!empty($pici)"}{$pici.name}{else /}暂无数据{/if}</span>
				<ul class="o_hidden">
					{if condition="!empty($pici)"}
					<li>
						<select onchange="window.location=this.value">
							<option value="/index/pingfen.html?sid={$aid}&pid={$pid}">考试等级选择</option>
							{volist name="card" id="c"}
							<option value="/index/pingfen.html?cid={$c.id}&pid={$pid}&sid={$aid}" {:$cid==$c.id?'selected':''}>{$c.name}</option>
							{/volist}
						</select>
					</li>
					{/if}
					{if condition="$cid  neq ''"}
					<li>
						<select onchange="window.location=this.value">
							<option value="/index/pingfen.html?cid={$cid}&pid={$pid}&sid={$aid}">分组选择</option>
							{volist name="group" id="g"}
							<option value="/index/pingfen.html?cid={$cid}&pid={$pid}&sid={$aid}&gid={$g.groups}" {:$gid==$g.groups?'selected':''}>第{$g.groups}组</option>
							{/volist}
						</select>
					</li>
					{/if}
					<!-- <li><a href="javascript:;" class="dd-buttom tijiao" style="margin-top:0;">保存</a></li> -->
					<li><a href="/index/school.html" class="dd-buttom" style="margin-top:0;">一键返回</a></li>
				</ul>
			</div>
			<div class="ac-ul o_hidden">
				<form id="myform">
					<ul class="o_hidden">
						{volist name="list" id="l"}
						<li class="hn">
							<div class="ac-ulist">
								<div class="ac-ttop">
									<div class="ac-uleft"><img src="{:$l.img!=''?$l.img:'/home/img/student_img.jpg'}"></div>
									<div class="ac-uright">
										<ul class="o_hidden">
											<li>编号：<span>{$l.num}</span><span style="margin-left:30px;color:red;">{$l.step}</span></li>
											<li>姓名：<span>{$l.name}</span></li>
											<li>性别：<span>{:$l.sex==1?'男':''}{:$l.sex==2?'女':''}</span></li>
											<li>年龄：<span></span>{$l.age}</li>
											<li>等级：<span></span>{$l.cname}</li>
										</ul>
									</div>
								</div>
								<div class="ac-bb o_hidden">
									<ul class="o_hidden student-score {:$l.score!=''?'cur':''}">
										<li data-id="{$l.id}" data-score="不及格" {:$l.score=='不及格'?'class="cur"':''}><p>不及格</p></li>
										<li data-id="{$l.id}" data-score="及格" {:$l.score=='及格'?'class="cur"':''}><p>及格</p></li>
										<li data-id="{$l.id}" data-score="良好" {:$l.score=='良好'?'class="cur"':''}><p>良好</p></li>
										<li data-id="{$l.id}" data-score="优良" {:$l.score=='优良'?'class="cur"':''}><p>优良</p></li>
										<li data-id="{$l.id}" data-score="优秀" {:$l.score=='优秀'?'class="cur"':''}><p>优秀</p></li>
										<li data-id="{$l.id}" data-score="缺考" {:$l.score=='缺考'?'class="cur"':''}><p>缺考</p></li>
										<!-- <a class="cur dx-tijiao" style="width: 16%">保存</a> -->
										<input type="hidden" name="id{$key}" value="{$l.id}">
										<input type="hidden" name="score{$key}" value="{$l.score}" data-id="{$l.num}" class="scores">
									</ul>
								</div>
							</div>
						</li>
						{/volist}
					</ul>
					{if condition="!empty($list)"}
					<div class="ac-list o_hidden" style="width: 100%;">
						<ul class="o_hidden">
							<li>
								<select name="teacher" style="width: 20%;display: inline-block;">
									<option value="">考官签字</option>
									{volist name="kaoguan" id="c"}
									<option value="{$c.id}">{$c.name}</option>
									{/volist}
								</select>
							</li>
							<li style="width: 20%;display: inline-block;"><a href="javascript:;" class="dd-buttom tijiao" style="margin-top:0;">保存</a></li>
						</ul>
					</div>
					{/if}
				</form>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="/demo/layer3.1.0/layer/layer.js"></script>
	<script>
		$(function(){
			$(".ac-bb ul li").click(function(){
				if(!$(this).parent("ul").hasClass("cur")){
					var score=$(this).attr("data-score");
					$(this).parent(".student-score").find(".scores").val(score);
					$(this).addClass("cur").siblings().removeClass("cur");
				}
			})

			//整体提交
			$(".tijiao").click(function(){
				var data=$("#myform").serialize();console.log(data);
				$.post("/index/pingfen.html",$("#myform").serialize(),function(res){
					console.log(res);
					if(res.code==200){
						layer.msg(res.msg,{icon:1,time:1500},function(){
							window.href=location.replace(location.href);
						});
					}else{
						layer.msg(res.msg,{icon:7,time:1500})
					}
				})
			})

			//单个评分
			$(".dx-tijiao").click(function(){
				var $this=$(this);
				if(!$(this).parent("ul").hasClass("cur")){
					var id=$(this).parent("ul").find(".cur").attr("data-id");
						score=$(this).parent("ul").find(".cur").attr("data-score");
					$.post("/index/dx_pingfen.html",{id:id,score:score,type:1},function(res){
						console.log(res);
						if (res.code==200) {
							layer.msg(res.msg,{icon:1,time:1000},function(){
								location.replace(location.href);
							});
						}else{
							layer.msg(res.msg,{icon:7,time:1000},function(){
								$this.parent("ul").find("li").removeClass("cur");
							})
						}
					})
				}
			})

		})
	</script>
</body>
</html>